package com.ltkj.pay.service.impl;

import com.ltkj.common.core.utils.DateUtils;
import com.ltkj.pay.domain.TicPayRefundLog;
import com.ltkj.pay.mapper.TicPayBusinessMapper;
import com.ltkj.pay.mapper.TicPayRefundLogMapper;
import com.ltkj.pay.service.ITicPayRefundLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 退款记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-15
 */
@Service
public class TicPayRefundLogServiceImpl implements ITicPayRefundLogService 
{
    @Autowired
    private TicPayRefundLogMapper ticPayRefundLogMapper;
    @Autowired
    private TicPayBusinessMapper ticPayBusinessMapper;
    /**
     * 查询退款记录
     * 
     * @param payRefundId 退款记录主键
     * @return 退款记录
     */
    @Override
    public TicPayRefundLog selectTicPayRefundLogByPayRefundId(Long payRefundId)
    {
        return ticPayRefundLogMapper.selectTicPayRefundLogByPayRefundId(payRefundId);
    }

    /**
     * 查询退款记录列表
     * 
     * @param ticPayRefundLog 退款记录
     * @return 退款记录
     */
    @Override
    public List<TicPayRefundLog> selectTicPayRefundLogList(TicPayRefundLog ticPayRefundLog)
    {
        return ticPayRefundLogMapper.selectTicPayRefundLogList(ticPayRefundLog);
    }

    /**
     * 新增退款记录
     * 
     * @param ticPayRefundLog 退款记录
     * @return 结果
     */
    @Override
    public int insertTicPayRefundLog(TicPayRefundLog ticPayRefundLog)
    {
        ticPayRefundLog.setCreateTime(DateUtils.getNowDate());
        return ticPayRefundLogMapper.insertTicPayRefundLog(ticPayRefundLog);
    }

    /**
     * 修改退款记录
     * 
     * @param ticPayRefundLog 退款记录
     * @return 结果
     */
    @Override
    public int updateTicPayRefundLog(TicPayRefundLog ticPayRefundLog)
    {
        ticPayRefundLog.setUpdateTime(DateUtils.getNowDate());
        return ticPayRefundLogMapper.updateTicPayRefundLog(ticPayRefundLog);
    }

    /**
     * 批量删除退款记录
     * 
     * @param payRefundIds 需要删除的退款记录主键
     * @return 结果
     */
    @Override
    public int deleteTicPayRefundLogByPayRefundIds(Long[] payRefundIds)
    {
        return ticPayRefundLogMapper.deleteTicPayRefundLogByPayRefundIds(payRefundIds);
    }

    /**
     * 删除退款记录信息
     * 
     * @param payRefundId 退款记录主键
     * @return 结果
     */
    @Override
    public int deleteTicPayRefundLogByPayRefundId(Long payRefundId)
    {
        return ticPayRefundLogMapper.deleteTicPayRefundLogByPayRefundId(payRefundId);
    }

    @Override
    public TicPayRefundLog selectTicPayRefundLogByOutRefundNo(String outRefundNo) {
        return ticPayBusinessMapper.selectTicPayRefundLogByOutRefundNo(outRefundNo);
    }
}
